<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <h1>JS 对象</h1>
    <hr>

    <script>
        function User(){
            this.name = '莉莉';
            this.age = 88;
            this.getInfo = function () {
                document.write('Hi~ o(*￣▽￣*)ブ <br>');
            }
        }

        User.prototype.getMsg = function(){
             document.write('(((((((((((っ･ω･)っ Σ(σ｀･ω･´)σ 起飞！<br>');
        }

        var o1 = new User();
        var o2 = new User();

        // console.log(o1, o2);
        
        // o1.getMsg = function(){
        //      document.write('(((((((((((っ･ω･)っ Σ(σ｀･ω･´)σ 起飞！');
        // }

        o1.getMsg();
        o2.getMsg();

        var a = 100;
        console.log(a.constructor);
        Number.prototype.hehe = function () {
            alert(this);
        }
        // a.hehe();
        
        Number.prototype.add = function (num) {
            return this + num;
        }

        console.log(a.add(100));
        console.log(99.8.add(1000));
        // console.log(100.add(100)); // NO
        console.log(100.0.add(100));
        console.log(100..add(100));

    </script>
</body>
</html>